﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Linq;
namespace Exact_Extension
{
    public partial class ARInformationForm : DevExpress.XtraEditors.XtraForm
    {
        ExactDataContext DS;
        IFormatProvider culture = new System.Globalization.CultureInfo("fr-FR", true);
        public ARInformationForm(ExactDataContext _DS)
        {
            InitializeComponent();
            DS = _DS;
            this.DateEdit_From.EditValue = DateTime.Now;
            this.DateEdit_To.EditValue = DateTime.Now;
        }

        private void btnLoad_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DateTime fromDate = Convert.ToDateTime(Convert.ToDateTime(this.DateEdit_From.EditValue).ToString("dd/MM/yyyy"),culture);
            DateTime fromTo = Convert.ToDateTime(Convert.ToDateTime(this.DateEdit_To.EditValue).ToString("dd/MM/yyyy"),culture);
            var query = from ARReport in DS.ISHCMC_F_ARReport(fromDate,fromTo)
                        select ARReport;
            this.iSHCMCFARReportResultBindingSource.DataSource = query;
        }

        private void btnExport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.pivotGridControl1.ShowRibbonPrintPreview();
        }




    }
}